import * as ActionTypes from './ActionTypes';
import Unit from '../../hml'

export const getPddList = (text,data,prevData) =>{
    // data.data.push.apply(data.data,prevData);
    // data.data = data.data.concat(prevData);
    data.data = [...data.data,...prevData];
    return {
        type:ActionTypes.GETPDD,
        text:text,
        data:data
    }
}


export const getFn = (text,ajaxCfg,dispatch,prevData) =>{
    return {
        type:ActionTypes.GETFN,
        text:text,
        ajaxFn:Unit.getApi(ajaxCfg).then((res)=>{
            dispatch(getPddList('发送请求1',res.data,prevData));
        })
    }
}
